// CyTargetLinker,
// a Cytoscape plugin to extend biological networks with regulatory interaction
//
// Copyright 2011-2013 Department of Bioinformatics - BiGCaT, Maastricht University
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package cytargetlinker.data;

import java.awt.Color;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import cytoscape.CyEdge;

public class RIN implements Comparable<RIN> {

	private String name;
	private File file;
	private boolean visible = true;
	private String interactionType;
	
	private List<CyEdge> edgesVisible;
	private List<CyEdge> edgesInvisible;	
	
	private List<Edge> edges;
	
	private Color color;
	
	public RIN() {
		edgesVisible = new ArrayList<CyEdge>();
		edgesInvisible = new ArrayList<CyEdge>();
		edges = new ArrayList<Edge>();
	}
	
	/**
	 * orders the RINs based on the number of new interactions
	 */
	@Override
	public int compareTo(RIN o) {
		return Integer.valueOf(o.getEdgesVisible().size()).compareTo(Integer.valueOf(getEdgesVisible().size()));
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public String getInteractionType() {
		return interactionType;
	}

	public void setInteractionType(String interactionType) {
		this.interactionType = interactionType;
	}

	public List<CyEdge> getEdgesVisible() {
		return edgesVisible;
	}

	public void setEdgesVisible(List<CyEdge> edgesVisible) {
		this.edgesVisible = edgesVisible;
	}

	public List<CyEdge> getEdgesInvisible() {
		return edgesInvisible;
	}

	public void setEdgesInvisible(List<CyEdge> edgesInvisible) {
		this.edgesInvisible = edgesInvisible;
	}

	public List<Edge> getEdges() {
		return edges;
	}

	public void setEdges(List<Edge> edges) {
		this.edges = edges;
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public int getTotal() {
		System.out.println("TOTAL:\t" + (getEdgesInvisible().size() + getEdgesVisible().size()) + "\t" + getEdges().size());
		return getEdges().size();
	}
}